int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
char qemu_file[PATH_MAX];
fd_set fds;
+ int ret = 0;
buffered_io_timer = qemu_new_timer(rt_clock, handle_buffered_io,
cpu_single_env);
xenstore_record_dm_state("running");
while (1) {
- while (!(vm_running && suspend_requested))
+ while (!((vm_running && suspend_requested) || shutdown_requested))
/* Wait up to 10 msec. */
main_loop_wait(10);
+ if (shutdown_requested) {
+ ret = EXCP_INTERRUPT;
+ break;
+ }
+
fprintf(logfile, "device model saving state\n");
/* Pull all outstanding ioreqs through the system */
xenstore_record_dm_state("running");
}
- return 0;
+ return ret;
}
void destroy_hvm_domain(void)